from datetime import *
from time import sleep as T
import os

tmNow = datetime.now()
d = date.today()
off=[]
with open('off.txt','r')as off_F:
    for i in off_F:
        off.append(i)
A=int(off[0])
B=int(off[1])
C=int(off[2])
t = time(A,B,C)
shtdownTime = datetime.combine(d,t)

def ShutDown():
    while True:
        tmNow = datetime.now()
        timedDelta = (shtdownTime - tmNow).total_seconds()
        if timedDelta < 181:
            os.system('shutdown -s -f -t 180')
            break
        else:
            continue
        T(5)
            
if __name__ == '__main__':
    ShutDown()
